Skip to content

Conversation

@senthilengg
Copy link
Contributor

@senthilengg senthilengg commented Oct 11, 2025

Description (*)

  • Trigger CollectTotals only if the below condition are true
  • Quote is not virtual
  • Check GraphQl ResolverInfo OperationType is not "query"

Related Pull Requests

https://github.com/magento-gl/magento2ee/pull/713

Fixed Issues (if relevant)

  1. Fixes Cart Query >> CartPrice GraphQl Performance Optimisation #40209

Manual testing scenarios (*)

  1. Include CartPrice in Cart Graphql
  2. Also test all cart mutations

Questions or comments

  1. Similar GraphQl context check can be used in other areas to make the api's faster

@m2-assistant
Copy link

m2-assistant bot commented Oct 11, 2025

Hi @senthilengg. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@ct-prd-pr-scan
Copy link

The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com.

@senthilengg
Copy link
Contributor Author

@magento run Unit Tests

@senthilengg
Copy link
Contributor Author

@magento run Unit Tests

@senthilengg
Copy link
Contributor Author

@magento run Database Compare,Functional Tests CE,Functional Tests EE,Functional Tests B2B,Integration Tests,Magento Health Index,Sample Data Tests CE,Sample Data Tests EE,Sample Data Tests B2B,Static Tests,WebAPI Tests,Semantic Version Checker

@senthilengg
Copy link
Contributor Author

@magento run Static Tests

@senthilengg
Copy link
Contributor Author

@magento run WebAPI Tests

Copy link
Contributor Author

@senthilengg senthilengg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved conflicts and Copyright format updated.

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@engcom-Hotel, please review this PR. I’ve fixed the Web API failure issue, so we can proceed with the further process for this PR.

@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Review in Progress to Ready for Testing in Community Dashboard Nov 14, 2025
@engcom-Dash engcom-Dash moved this from Ready for Testing to Extended testing (optional) in Community Dashboard Nov 18, 2025
@engcom-Dash engcom-Dash moved this from Extended testing (optional) to Testing in Progress in Community Dashboard Nov 18, 2025
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

engcom-Dash commented Nov 20, 2025

Hello @senthilengg

Thanks for the contribution!

✔️ QA Passed

Preconditions:
Install fresh Magento 2.4-develop

Manual testing scenarios

  1. Created a large number of simple products.
  2. Applied a Cart Price Rule to the created products.
  3. Added multiple products to the cart.
  4. Fetched the cart price with discount.
image Execution Time: 1320 ms
  1. Fetched the cart price without discount.
image

Execution Time: 578 ms

Builds are failed. Hence, moving this PR to Extended Testing.

@engcom-Dash engcom-Dash moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Nov 20, 2025
@engcom-Dash
Copy link
Contributor

@magento run Integration Tests, WebAPI Tests, Functional Tests EE, Functional Tests B2B

@senthilengg
Copy link
Contributor Author

@engcom-Dash this PR avoid loading totals for cart.prices you have tested with cart.items.prices which still triggers collect totals.

I have fixed cart.items.prices total load separately in #40289

@engcom-Dash
Copy link
Contributor

@engcom-Dash this PR avoid loading totals for cart.prices you have tested with cart.items.prices which still triggers collect totals.

I have fixed cart.items.prices total load separately in #40289

@senthilengg I have updated the above testing steps

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@magento run Unit Tests, Functional Tests EE, Functional Tests B2B, Functional Tests CE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P3 May be fixed according to the position in the backlog. Progress: ready for testing Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Projects

Status: Extended testing (optional)

Development

Successfully merging this pull request may close these issues.

Cart Query >> CartPrice GraphQl Performance Optimisation

5 participants